import Vue from 'vue';
import fastclick from 'fastclick';
import superagent from 'superagent';
import moment from 'moment';
import store from './vuex/';
import router from './router/';
import wujieActivity from './wujie-activity';

import { sync } from 'vuex-router-sync'

// import  { ConfirmPlugin } from 'vux'
// Vue.use(ConfirmPlugin)

moment.locale('zh-cn');

Vue.prototype.$http = superagent;
Vue.prototype.$moment = moment;
Vue.prototype.$domain = '';

sync(store, router)

router.beforeEach(function (to, from, next) {
  store.commit('updateLoadingStatus', {isLoading: true})
  next()
})

router.afterEach(function (to) {
  store.commit('updateLoadingStatus', {isLoading: false})
})


fastclick.attach(document.body);

new Vue({
  router,
  store,
  render: h => h(wujieActivity),
}).$mount('#unique');
